﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 区域预算配置表基础输入参数
/// </summary>
public class StoreBudgetConfigBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 区域ID
    /// </summary>
    [Required(ErrorMessage = "区域ID不能为空")]
    public virtual long? OrgsId { get; set; }
    
    /// <summary>
    /// 预算开始时间
    /// </summary>
    [Required(ErrorMessage = "预算开始时间不能为空")]
    public virtual DateTime StartDate { get; set; }
    
    /// <summary>
    /// 预算结束时间
    /// </summary>
    [Required(ErrorMessage = "预算结束时间不能为空")]
    public virtual DateTime EndDate { get; set; }
    
    /// <summary>
    /// 总预算额度
    /// </summary>
    [Required(ErrorMessage = "总预算额度不能为空")]
    public virtual decimal? TotalAmount { get; set; }
    
    /// <summary>
    /// 预算名称
    /// </summary>
    public virtual string? BudgetName { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
}

/// <summary>
/// 区域预算配置表分页查询输入参数
/// </summary>
public class PageStoreBudgetConfigInput : BasePageInput
{
    /// <summary>
    /// 区域ID
    /// </summary>
    public long? OrgsId { get; set; }
    
    /// <summary>
    /// 预算名称
    /// </summary>
    public string? BudgetName { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 区域预算配置表增加输入参数
/// </summary>
public class AddStoreBudgetConfigInput
{
    /// <summary>
    /// 区域ID
    /// </summary>
    [Required(ErrorMessage = "区域ID不能为空")]
    public long? OrgsId { get; set; }
    
    /// <summary>
    /// 预算开始时间
    /// </summary>
    [Required(ErrorMessage = "预算开始时间不能为空")]
    public DateTime StartDate { get; set; }
    
    /// <summary>
    /// 预算结束时间
    /// </summary>
    [Required(ErrorMessage = "预算结束时间不能为空")]
    public DateTime EndDate { get; set; }
    
    /// <summary>
    /// 总预算额度
    /// </summary>
    [Required(ErrorMessage = "总预算额度不能为空")]
    public decimal? TotalAmount { get; set; }
    
    /// <summary>
    /// 预算名称
    /// </summary>
    [MaxLength(128, ErrorMessage = "预算名称字符长度不能超过128")]
    public string? BudgetName { get; set; }
    
    /// <summary>
    /// 预警阈值
    /// </summary>
    public decimal? WarningThreshold { get; set; } = 80;
    
    /// <summary>
    /// 是否启用预警
    /// </summary>
    public bool? IsWarningEnabled { get; set; } = true;
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(256, ErrorMessage = "备注字符长度不能超过256")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 区域预算配置表删除输入参数
/// </summary>
public class DeleteStoreBudgetConfigInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 区域预算配置表更新输入参数
/// </summary>
public class UpdateStoreBudgetConfigInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 区域ID
    /// </summary>    
    [Required(ErrorMessage = "区域ID不能为空")]
    public long? OrgsId { get; set; }
    
    /// <summary>
    /// 预算开始时间
    /// </summary>    
    [Required(ErrorMessage = "预算开始时间不能为空")]
    public DateTime StartDate { get; set; }
    
    /// <summary>
    /// 预算结束时间
    /// </summary>    
    [Required(ErrorMessage = "预算结束时间不能为空")]
    public DateTime EndDate { get; set; }
    
    /// <summary>
    /// 总预算额度
    /// </summary>    
    [Required(ErrorMessage = "总预算额度不能为空")]
    public decimal? TotalAmount { get; set; }
    
    /// <summary>
    /// 预算名称
    /// </summary>    
    [MaxLength(128, ErrorMessage = "预算名称字符长度不能超过128")]
    public string? BudgetName { get; set; }
    
    /// <summary>
    /// 预警阈值
    /// </summary>
    public decimal? WarningThreshold { get; set; }
    
    /// <summary>
    /// 是否启用预警
    /// </summary>
    public bool? IsWarningEnabled { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(256, ErrorMessage = "备注字符长度不能超过256")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 区域预算配置表主键查询输入参数
/// </summary>
public class QueryByIdStoreBudgetConfigInput : DeleteStoreBudgetConfigInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataStoreBudgetConfigInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 区域预算配置表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportStoreBudgetConfigInput : BaseImportInput
{
    /// <summary>
    /// 区域ID 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? OrgsId { get; set; }
    
    /// <summary>
    /// 区域ID 文本
    /// </summary>
    [ImporterHeader(Name = "*区域ID")]
    [ExporterHeader("*区域ID", Format = "", Width = 25, IsBold = true)]
    public string OrgsFkDisplayName { get; set; }
    
    /// <summary>
    /// 预算开始时间
    /// </summary>
    [ImporterHeader(Name = "*预算开始时间")]
    [ExporterHeader("*预算开始时间", Format = "", Width = 25, IsBold = true)]
    public DateTime StartDate { get; set; }
    
    /// <summary>
    /// 预算结束时间
    /// </summary>
    [ImporterHeader(Name = "*预算结束时间")]
    [ExporterHeader("*预算结束时间", Format = "", Width = 25, IsBold = true)]
    public DateTime EndDate { get; set; }
    
    /// <summary>
    /// 总预算额度
    /// </summary>
    [ImporterHeader(Name = "*总预算额度")]
    [ExporterHeader("*总预算额度", Format = "", Width = 25, IsBold = true)]
    public decimal? TotalAmount { get; set; }
    
    /// <summary>
    /// 预算名称
    /// </summary>
    [ImporterHeader(Name = "预算名称")]
    [ExporterHeader("预算名称", Format = "", Width = 25, IsBold = true)]
    public string? BudgetName { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 手动刷新预算输入参数
/// </summary>
public class RefreshBudgetInput
{
    /// <summary>
    /// 预算配置ID
    /// </summary>
    [Required(ErrorMessage = "预算配置ID不能为空")]
    public long Id { get; set; }
}
